<?php

foreach ($container as $item) {
    $url = "/blog/post-{$item['id']}.html";
    $date = humanizer_datetime($item['posttime']);
    $modifydate = humanizer_datetime($item['modify']);
    if ($item['postname']) {
        $url = "/blog/post-{$item['postname']}.html";
    }
    $clicks = number_format($item['clicks']);
    $top = '';
    $nickname=getnickname($item['adminuid']);
    if ($item['top']) {
        $top = '<span style="color: #cc0000">[置顶]</span>';
    }
    echo <<<HTML
<div class="item mb-5">
    <div class="row g-3 g-xl-0">
        <div style="padding-right: 1rem;" class="col-2 col-xl-3">
            <img style="width: 100%;height: auto" class="img-fluid post-thumb " src="{$item['pic']}" alt="image">
        </div>
        <div class="col">
            <h3 class="title mb-1">{$top}<a class="text-link" href="{$url}">{$item['title']}</a></h3>
            <div class="meta mb-1"><span class="date">发布于 {$date}</span>
            <span class="text-link">{$clicks} 次浏览</span>
            <span class="text-link"><a class="text-link" href="/blog/s-AUTHOR:{$item['adminuid']}:{$nickname}">{$nickname}</a></span>
            </div>
            <div class="intro">
                {$item['description']}...
            </div>
            <a class="text-link" href="{$url}">阅读更多 &rarr;</a>
        </div><!--//col-->
    </div><!--//row-->
</div><!--//item-->
HTML;
}